import React,{Component} from 'react';
import Parallax from 'parallax-js';
import logo from 'images/login/logo.png';
import logoEn from 'images/login/logo-en.png';
import logoBD from 'images/login/logo-bd.png';
import layer1 from 'images/login/layer01.png';
import layer2 from 'images/login/layer02.png';
import layer3 from 'images/login/layer03.png';
export default class extends Component{
  componentDidMount(){
    this.initScene();
  }
  //初始化场景
  initScene = () => {
    let scene = document.getElementById('scene');
    new Parallax(scene, {
      calibrateX: true
    });
  };
  render(){
    let {language}= this.props
    return (
      <div id="scene">
        <img
          src={window.isBaiduAiCloud ? logoBD : (language.locale !== 'zh' ? logoEn : logo)}
          className="img-logo"
          style={window.isBaiduAiCloud ? {height: 120} : {}}
        />
        <div data-depth="0.2"><img src={layer1}/></div>
        <div data-depth="0.4"><img src={layer2}/></div>
        <div data-depth="0.6"><img src={layer3}/></div>
      </div>
    )
  }
}
